﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class LogonControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["UID"] != null)
            {
                int id = Convert.ToInt32(Session["UID"].ToString());
                if (id > 0)
                {
                    divFormCurrent.Style.Add("display", "block");
                    divFormLink.Style.Add("display", "none");
                }
                else
                {
                    divFormLink.Style.Add("display", "block");
                    divFormCurrent.Style.Add("display", "none");
                }
            }
            else
            {
                divFormLink.Style.Add("display", "block");
                divFormCurrent.Style.Add("display", "none");
            }
        }
    }
    protected void lbtnLogOut_Click(object sender, EventArgs e)
    {
        if (Session["UID"] != null)
        {
            Session["UID"] = null;
            Response.Redirect("home.aspx");
        }
    }
}